import request from "../utils/request";

// 用户登录
const userLogin = 'members/wechat-mpwx/login'
// 商品列表
const goodsList = 'goods/list'
// 商品详情
const goodsDetail = 'goods/'
// 商品评价
const goodsRate ='goods/'
// 收藏列表
const collectList ='members/collection-goods/list'
// 收藏
const collect ='members/goods/collect'
// 取消收藏
const cancel ='members/goods/cancel-collection'

// 登录
export function loginBtn(data) {
	return request({
		url: userLogin,
		method: "post",
		data
	})
}


export function getLogo(data) {
	return request({
		url: "shops/logo",
		method: "get",
		data
	})
}


// 商品列表
export function getGoodsList(data) {
	return request({
		url: goodsList,
		method: "get",
		data
	})
}
// 通知
export function getNotice(data) {
	return request({
		url: 'shops/announcements',
		method: "get",
		data
	})
}
// 导航栏

export function getNavigation(data) {
	return request({
		url: 'shops/navigations',
		method: "get",
		data
	})
}
// 轮播图
export function getSwiper(data) {
	return request({
		url: 'shops/carousels',
		method: "get",
		data
	})
}



// 商品详情
export function getGoodsDetail(id, data) {
	return request({
		url: goodsDetail+id+"/details",
		method: "get",
		data
	})
}
// 商品评价
export function getGoodsRate(id, data) {
	return request({
		url: goodsDetail+id+"/appraises/list",
		method: "get",
		data
	})
}
// 收藏列表
export function getCollectList(data) {
	return request({
		url: collectList,
		method: "get",
		data
	})
}

// 收藏
export function collectBtn(data) {
	return request({
		url: collect,
		method: "post",
		data
	})
}


// 取消收藏
export function cancelCollect(data) {
	return request({
		url: cancel,
		method: "post",
		data
	})
}

export function getAddressList(data) {
	return request({
		url: 'members/delivery-addresses',
		method: "get",
		data
	})
}

export function getDefaultAddress(data) {
	return request({
		url: 'members/default-delivery-addresses',
		method: "get",
		data
	})
}


export function delAddressBtn(data) {
	return request({
		url: "members/delivery-addresses/delete",
		method: "post",
		data
	})
}

export function editAddress(id,data) {
	return request({
		url: `members/delivery-addresses/${id}/change`,
		method: "post",
		data
	})
}

export function getAddress(id,data) {
	return request({
		url: `members/delivery-addresses/${id}/details`,
		method: "get",
		data
	})
}



export function addAddressBtn(data) {
	return request({
		url: `members/delivery-addresses/create`,
		method: "post",
		data
	})
}

export function setDefault(data) {
	return request({
		url: `members/delivery-addresses/set-default`,
		method: "post",
		data
	})
}


export function feedbackType(data) {
	return request({
		url: `members/feedback-types`,
		method: "get",
		data
	})
}

export function feedback(data) {
	return request({
		url: `members/feedback`,
		method: "post",
		data
	})
}


export function getPointGoods(data) {
	return request({
		url: `point-shops/goods/list`,
		method: "get",
		data
	})
}

export function getPointDetail(id,data) {
	return request({
		url: `point-shops/goods/${id}/details`,
		method: "get",
		data
	})
}
export function getComment(id,data) {
	return request({
		url: `goods/${id}/appraises/list`,
		method: "get",
		data
	})
}


export function addCartBtn(data) {
	return request({
		url: `members/carts/add`,
		method: "post",
		data
	})
}
export function createRorder(data) {
	return request({
		url: `members/goods/reservation/create`,
		method: "post",
		data
	})
}

export function wxPay(data) {
	return request({
		url: `members/orders/wechat-pay`,
		method: "post",
		data
	})
}

export function yyPay(data) {
	return request({
		url: `members/goods/reservation/pay`,
		method: "post",
		data
	})
}
export function getPlist(data) {
	return request({
		url: `members/goods/reservation/list`,
		method: "get",
		data
	})
}
export function getPlistDetail(id,data) {
	return request({
		url: `members/goods/reservation/${id}/detail`,
		method: "get",
		data
	})
}

export function createOrder(data) {
	return request({
		url: `members/order/buy-now`,
		method: "post",
		data
	})
}

export function getCollect(data) {
	return request({
		url: `members/collection-goods/list`,
		method: "get",
		data
	})
}

export function getzj(data) {
	return request({
		url: `members/record/list`,
		method: "get",
		data
	})
}

export function clearzj(data) {
	return request({
		url: `members/record/clear`,
		method: "get",
		data
	})
}

export function getWechatPay(data) {
	return request({
		url: `members/orders/pay`,
		method: "post",
		data
	})
}

export function getOrderList(data) {
	return request({
		url: `members/orders/list`,
		method: "get",
		data
	})
}

export function getOrderDetail(id,data) {
	return request({
		url: `members/orders/${id}/details`,
		method: "get",
		data
	})
}

export function cancelOrder(data) {
	return request({
		url: `members/orders/cancel`,
		method: "post",
		data
	})
}
export function commitOrder(data) {
	return request({
		url: `members/order-goods/appraise`,
		method: "post",
		data
	})
}
export function refundOrder(data) {
	return request({
		url: `members/orders/refund`,
		method: "post",
		data
	})
}
export function getExpress(data) {
	return request({
		url: `shops/support-expresses`,
		method: "get",
		data
	})
}

export function confirmOrder(data) {
	return request({
		url: `members/orders/receipt`,
		method: "post",
		data
	})
}

export function exchange(data) {
	return request({
		url: `members/point-shops/goods/redeem`,
		method: "post",
		data
	})
}

export function getBills(id,data) {
	return request({
		url: `members/bills?type=${id}`,
		method: "get",
		data
	})
}
export function getPointBills(data) {
	return request({
		url: `members/points/list`,
		method: "get",
		data
	})
}

export function getKhImg(data) {
	return request({
		url: `members/my-share-member-image`,
		method: "get",
		data
	})
}

export function getTgImg(data) {
	return request({
		url: `members/my-share-sales-image`,
		method: "get",
		data
	})
}

export function getLowers(data) {
	return request({
		url: `members/teams`,
		method: "get",
		data
	})
}

export function apply(data) {
	return request({
		url: `members/sales/apply`,
		method: "post",
		data
	})
}

export function myPointList(data) {
	return request({
		url: `members/point-redeem-histories/list`,
		method: "get",
		data
	})
}
export function myPointDetail(id,data) {
	return request({
		url: `members/point-redeem-histories/${id}/details`,
		method: "get",
		data
	})
}
export function getCartList(data) {
	return request({
		url: `members/carts`,
		method: "get",
		data
	})
}

export function cartDecrease(data) {
	return request({
		url: `members/carts/decrease`,
		method: "post",
		data
	})
}
export function cartIncrease(data) {
	return request({
		url: `members/carts/increase`,
		method: "post",
		data
	})
}
export function cartDelete(data) {
	return request({
		url: `members/carts/delete`,
		method: "post",
		data
	})
}
export function cartSettle(data) {
	return request({
		url: `members/carts/settle`,
		method: "get",
		data
	})
}
export function getRegionList(data) {
	return request({
		url: `public/test`,
		method: "get",
		data
	})
}

export function getSystem(data) {
	return request({
		url: `public/system`,
		method: "get",
		data
	})
}

// 订单实例化
export function OrderShow(data) {
	return request({
		url: `members/order/buy-now`,
		method: "get",
		data
	})
}
export function getGoodsSort(data) {
	return request({
		url: `shops/industry/list`,
		method: "get",
		data
	})
}
export function getSortList(id,data) {
	return request({
		url: `goods/${id}/list`,
		method: "get",
		data
	})
}
export function getStoreDetail(id,data) {
	return request({
		url: `shops/store/${id}/detail`,
		method: "get",
		data
	})
}
export function getCateGory(id,data) {
	return request({
		url: `shops/store/${id}/category`,
		method: "get",
		data
	})
}

export function storeCreate(data) {
	return request({
		url: `members/store/create`,
		method: "post",
		data
	})
}

export function getStoreStatus (data) {
	return request({
		url: `members/store/details`,
		method: "get",
		data
	})
}
export function updateStoreSettle (data) {
	return request({
		url: `members/store/update`,
		method: "post",
		data
	})
}

export function getStoreComment(id,data) {
	return request({
		url: `shops/store/${id}/comment`,
		method: "get",
		data
	})
}


























































